package com.zbkj.front.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zbkj.dal.pojo.response.UserAddressVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalTime;

@Data
@ApiModel("预约归还-上门取件")
public class ReserveRentReturnPickUpVO {

    @ApiModelProperty("快递名称")
    private String deliveryName;

    @ApiModelProperty("取件码")
    private String pickupCode;

    @ApiModelProperty(value = "取件日期", example = "2024-02-02")
    private LocalDate pickUpDate;

    @ApiModelProperty(value = "取件时间段", example = "09:00:00")
    @JsonFormat(pattern = "HH:mm:ss")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalTime startTime;

    @ApiModelProperty(value = "取件时间段", example = "09:00:00")
    @JsonFormat(pattern = "HH:mm:ss")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalTime endTime;

    @ApiModelProperty("日期描述 今天，明天，后天")
    private String dateDesc;

    @ApiModelProperty("寄件人地址信息")
    private UserAddressVO userAddressVO;

    /**
     * 不可去掉，否则展示有问题
     * @return
     */
    public String getSenderName(){
        return userAddressVO.getRealName();
    }

    /**
     * 不可去掉，否则展示有问题
     * @return
     */
    public String getSenderPhone(){
        return userAddressVO.getPhone();
    }

    /**
     * 不可去掉，否则展示有问题
     * @return
     */
    public String getSenderAddress(){
        return userAddressVO.getFullAddress();
    }

}
